/**
 * 单例模式
 * by wyy
 */
class Singleton {
    constructor() { }

    /**
     * 获取一个带参数的单例
     * @param param 
     * @returns {any}
     */
    static instance(...param: any[]): any {
        let Clz: any = this;
        (!Clz._instance) && (Clz._instance = new Clz(...param));
        return Clz._instance;
    }
}